using System.ComponentModel.DataAnnotations.Schema;

namespace Wips.Domain.Models.Authorities.Model
{
    /// <summary>
    /// 职位角色
    /// </summary>
    [Table("AuthorityPositionRoles")]
    [SugarTable("AuthorityPositionRoles")]
    public class PositionRole : ValueObjectBase
    {
        public PositionRole()
        {
        }

        /// <summary>
        /// 职位ID
        /// </summary>
        public string PositionId { get; set; }

        /// <summary>
        /// 职位
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(PositionId))]
        public Position Position { get; set; }

        /// <summary>
        /// 角色ID
        /// </summary>
        public string RoleId { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(RoleId))]
        public Role Role { get; set; }

        public PositionRole(string positionId, string roleId)
        {
            PositionId = positionId;
            RoleId = roleId;
        }
    }
}